import ajax from './index'

export function alibaba_group() {
  return ajax({
    url: "/pms/alibaba/groups",
    method: "get"
  });
}

export function alibaba_group_sync() {
  return ajax({
    url: "/pms/alibaba/group_sync",
    method: "post",
  });
}

export function alibaba_goods_list(group_id, condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/pms/alibaba/productList",
    method: "get",
    params: condition
  });
}

export function alibaba_goods_sync(group_id) {
  return ajax({
    url: "/pms/alibaba/goods_sync/" + group_id,
    method: "post",
  });
}

export function alibaba_goods_detail_sync(goods_id) {
  return ajax({
    url: "/pms/alibaba/productDetails/" + goods_id,
    method: "get",
  });
}
